<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<html>
  <head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">

    <!--                                                               -->
    <!-- Consider inlining CSS to reduce the number of requested files -->
    <!--                                                               -->
    <link type="text/css" rel="stylesheet" href="pageapi.css">
    <link type="text/css" rel="stylesheet" href="css/table.css">
    <link type="text/css" rel="stylesheet" href="qqmail.css">
    <link type="text/css" rel="stylesheet" href="css/items.css">
    
    <!--                                           -->
    <!-- Any title is fine                         -->
    <!--                                           -->
    <title>淘宝页面流程化项目测试环境</title>
  </head>
<body>
<script type="text/javascript" src="<%= request.getQueryString().substring("url=".length())
%>"></script>
<script>
var t = false;

function pa(){
   if(!t || typeof printAddress !=='function'){
      t=setTimeout("pa()",500);
      return;
   }
   try{
      printAddress();
      clearTimeout(t);   
   }catch(e){}
}

function onSubmit(){
	var v = "";
	try {
		v = getTBAddressInfo();
		if(v === false){
			alert("收货地址不完整");
			return;
		}
		if( !v ){
			alert("收货地址不完整");
			return;
		}
	} catch (e) {}

	var as = document.getElementsByName('tb_address');
	
	parent.buy(v,(as.length-1)+"");
}
</script>
<script>
pa();
</script>

<input type='button' onclick='onSubmit();' value='购买'/>

</body>
<html>
